#include <ros/ros.h>
#include <std_msgs/String.h>

void callback(std_msgs::String msg)
{
    ROS_INFO("%s", msg.data.c_str());
}

int main(int argc, char *argv[])
{
    ros::init(argc, argv, "subscriber_node");
    ros::NodeHandle nh;
    ros::Subscriber sub = nh.subscribe<std_msgs::String>("/helloworld", 10, callback);

    while(ros::ok())
    {
        ros::spinOnce();
    }

    return 0;
}